#pragma once


#include<iostream>
#include<time.h>
#include<string>


const std::string getCurrentTime()
{
    // auto tm = localtime(&time(nullptr)); // zdl:: 原来这楼里不支持使用右值
    auto t = time(nullptr);
    auto curr = ::localtime(&t); // 现在设置好时间搓
    char currentTime[32];
    snprintf(currentTime, sizeof currentTime, "%d-%d-%d %d:%d:%d", curr->tm_year + 1900, 
        curr->tm_mon + 1, curr->tm_mday,
        curr->tm_hour, curr->tm_min, 
        curr->tm_sec
    );
    return currentTime;
}